from typing import List


class Solution:
    def uniqueMorseRepresentations(self, words: List[str]) -> int:
        char_list = [".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", "---",
         ".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."]
        word_dict = {}
        midle_word = ""
        for i in words:
            for j in i :
                midle_word +=char_list[ord(j)-ord('a')]
            print(midle_word)
            if midle_word not in word_dict:

                word_dict[midle_word] =1
            midle_word = ""

        return len(word_dict)

if __name__ == '__main__':
    words = ["gin","zen","gig","msg"]
    soluton =   Solution()
    val = soluton.uniqueMorseRepresentations(words)
    print(val)